<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.staticfile.net/jquery/3.7.1/jquery.min.js"></script>
</head>
<body>
    <button id="btnget">get</button>
    <button id="btnpost">post</button>
    <button id="btndelete">delete</button>
    <script>
     $(()=>{
     $('#btnget').on('click',()=>{
        $.ajax({
            type:'get',
            url:'http://127.0.0.1/api/get',
            data:{name:'zs',age:18,gender:'male'},
            success:(res)=>{
                console.log(res)
            }
        })
     })
    
      $('#btnpost').on('click',()=>{
        $.ajax({
            type:'post',
            url:'http://127.0.0.1/api/post',
            data:{book:'水浒准',author:'施耐庵'},
            success:(res)=>{
                console.log(res)
            }
        })
     })
      $('#btndelete').on('click',()=>{
        $.ajax({
            type:'delete',
            url:'http://127.0.0.1/api/delete',
            success:(res)=>{
                console.log(res)
            }
        })
     })
     })
    </script>
</body>
</html>